Skip to content

Conversation

@BobbyRadford
Copy link
Contributor

@BobbyRadford BobbyRadford commented Jun 15, 2021

Support the IBMCloud platform in Manual mode for IPI/UPI.

Related to #344 and openshift/enhancements#773

Support the IBMCloud platform in manual mode. Update ccoctl to handle
IBMCloud credentialsrequests by essentially emulating Passthrough mode.
An API key environment variable is used to populate a specific field in
the secret.
@BobbyRadford
Copy link
Contributor Author

/retest

Copy link
Contributor

@dgoodwin dgoodwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me for a first cut until we can get defined permissions in there. Just a couple minor requests.

@BobbyRadford
Copy link
Contributor Author

@dgoodwin thanks for the review. I pushed up a couple of commits to fix things up.

@dgoodwin
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 16, 2021
Copy link
Contributor

@akhil-rane akhil-rane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few suggestions

Comment on lines 11 to 12
credreqv1 "github.com/openshift/cloud-credential-operator/pkg/apis/cloudcredential/v1"
"github.com/openshift/cloud-credential-operator/pkg/cmd/provisioning"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep consistency, these imports should come in a separate block at the end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Hopefully I understood you correctly.

// NewCreateCmd implements the "create" command for the credentials provisioning
func NewCreateCmd() *cobra.Command {
createCmd := &cobra.Command{
Use: "create",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by command conventions that we follow, this should be create-secrets I feel. @dgoodwin WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's no problem. Changed to create-secrets

Comment on lines 28 to 48
{
name: "Generate Secret for one CredentialsRequest",
setup: func(t *testing.T) string {
tempDirName, err := ioutil.TempDir(os.TempDir(), testDirPrefix)
require.NoError(t, err, "Failed to create temp directory")

err = testCredentialsRequest(t, "firstcredreq", "namespace1", "secretName1", tempDirName)
require.NoError(t, err, "Errored while setting up test CredReq files")

return tempDirName
},
verify: func(t *testing.T, targetDir string) {
files, err := ioutil.ReadDir(targetDir)
require.NoError(t, err, "Unexpected error listing files in targetDir")

assert.Equal(t, 1, len(files), "Should be exactly 1 Secret generated for 1 CredentialsRequest")
},
cleanup: func(t *testing.T) {
return
},
expectError: false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a test that does setting IC_API_KEY in setup and verify if generated secret actually has that key? Also, one negative test where env var is not set and error is thrown.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 16, 2021
Copy link
Contributor

@akhil-rane akhil-rane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 17, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 17, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akhil-rane, BobbyRadford, dgoodwin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

4 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@BobbyRadford
Copy link
Contributor Author

Ran into this on a very recent Installer PR, but seems like AWS e2e tests are failing due to some throttling issues. We ended up getting GCP tests to run instead. Is that something we can do here to progress this PR? @akhil-rane @dgoodwin openshift/installer#4923 (comment)

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

3 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit a7cf3d6 into openshift:master Jun 19, 2021
// NewCreateSecretsCmd implements the "create-secrets" command for the credentials provisioning
func NewCreateSecretsCmd() *cobra.Command {
createSecretsCmd := &cobra.Command{
Use: "create-secrets",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BobbyRadford I was discussing this with the team and I was wondering if a name like create-shared-secrets would be better.
I'm comparing this to the existing aws support and there is no equivalent create-secrets subcommand (today) for AWS (which isn't surprising b/c of lack of support for passthrough-equivalent mode). So this subcommand feels specific to implementing Passthrough mode and the name of the command should reflect that.

Could we rename this to something like create-shared-secrets and have the long description make it clear that this subcommand just takes the API key from an env var and uses it to satisfy all the CredentialsRequests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @joelddiaz no problem. Will make that happen.

ming1013 pushed a commit to ming1013/cloud-credential-operator that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants